package net.homeip.jcperera.nu.security.credential;

import java.security.PublicKey;

import javax.inject.Named;

/**
 * Certificate class, for implementing just another type of identification method
 * 
 * @name Certificate class
 * @author julio.c.perera@gmail.com
 * @application nu
 * @since 0.1.0.0
 */

@Named(Certificate.componentName)
public class Certificate extends Credential
{
    // Required to implement Serializable interface
    private static final long  serialVersionUID = -9198037037983295584L;

    // CoreBase properties, for easy use from other components, as well as logging
    public static final int    runtimeLevel     = 2;
    public static final String moduleName       = "security";
    public static final String componentName    = "nu_security_credential_certificate";

    /**
     * Verifies that this certificate was signed using the private key that corresponds to the specified public key
     * 
     * @see Certificate#verify(PublicKey)
     * @param valueToVerify
     *            the other <code>Certificate</code> used to carry out the verification
     */
    public boolean verify(Certificate valueToVerify)
    {
        return true;
    }

    /**
     * Gets the current value of the current credential, for persistence related functionality (mostly), you should not
     * use this value to make comparisons, but use the method {@link #verify()} instead
     */
    @Override
    public String toString()
    {
        return "";
    }

    /**
     * Verifies that the Credential is valid against the reference passed as parameter
     * 
     * @param valueToVerify
     *            the reference value to check against
     */
    @Override
    public boolean verify(Credential valueToVerify)
    {
        return false;
    }
}